package com.first.system.controller;

import com.first.common.pojo.TbHeadNav;
import com.first.common.vo.Result;
import com.first.system.service.PreService;
import com.first.system.vo.PreVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: first-project
 * @description:
 * @author: 闫锦超
 * @create: 2023-05-26 14:37
 **/
@RestController
@RequestMapping("/home/head")
@Api(tags = "头部管理")
public class PreController {

    @Autowired
    private PreService preService;

    @PostMapping("/getAllHeadNav/{currentPage}/{pageSize}")
    @ApiOperation("获取专区管理数据")
    public Result getAllHeadNav(@PathVariable Integer currentPage, @PathVariable Integer pageSize, @RequestBody PreVo preVo){
        return preService.getAllHeadNav(currentPage,pageSize,preVo);
    }

    @PostMapping("/changeStatus/{headId}/{isDiable}")
    @ApiOperation("修改头部导航状态")
    public Result changeStatus(@PathVariable Integer headId,@PathVariable String isDiable){
            return preService.changeStatus(headId,isDiable);
    }

    @PostMapping("/deleteHeadNav")
    @ApiOperation("删除头部导航")
    public Result deleteHeadNav(@RequestBody TbHeadNav tbHeadNav){
        return preService.deleteHeadNav(tbHeadNav);
    }

    @PostMapping("/addHeadNav")
    @ApiOperation(value = "增加头部导航")
    public Result addHeadNav(@RequestBody TbHeadNav tbHeadNav){
            return preService.addHeadNav(tbHeadNav);
    }

    @PostMapping("/updateHeadNav")
    @ApiOperation(value = "修改头部导航")
    public Result updateHeadNav(@RequestBody TbHeadNav tbHeadNav){
        return preService.updateHeadNav(tbHeadNav);
    }



}